#include "Square.h"
#include "SDL.h"
#include "SDL_opengl.h"
#include <string>

Square::Square(void)
{
	x = 0.0f;
	y = 0.0f;
	xVelocity = 0.0f;
	yVelocity = 0.0f;
}

Square::~Square(void)
{
}

void Square::draw()
{
	glClear(GL_COLOR_BUFFER_BIT);
	glTranslatef(x, y, 0);
	glBegin(GL_QUADS);
		glColor3f(0.5f, 0.4f, 0.7f);
		glVertex3f( (-0.3f+x) , (0.3f+y)  , 0.0f);				// Top Left
		glVertex3f( (0.3f+x)  , (0.3f+y)  , 0.0f);				// Top Right
		glVertex3f( (0.3f+x)  , (-0.3f+y) , 0.0f);				// Bottom Right
		glVertex3f( (-0.3f+x) , (-0.3f+y) , 0.0f);				// Bottom Left
	glEnd();
	glLoadIdentity();
}

void Square::moveLeft()
{
	x -= 0.01f;
}

void Square::moveRight()
{
	x += 0.01f;
}

void Square::moveUp()
{
	y += 0.01f;
}

void Square::moveDown()
{
	y -= 0.01f;
}